<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>支付成功</title>
</head>

<body>
    <h1>支付成功</h1>
<!--<button id="backButton">返回 UniApp</button>-->
<script>
    document.getElementById('backButton').addEventListener('click', function () {
        // 尝试使用通用的 postMessage 方法
        if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.postMessage) {
            // iOS 环境
            window.webkit.messageHandlers.postMessage.postMessage('goBackToUniApp');
        } else if (window.ReactNativeWebView) {
            // React Native WebView 环境
            window.ReactNativeWebView.postMessage('goBackToUniApp');
        } else {
            // 其他环境，尝试直接调用
            window.postMessage('goBackToUniApp', '*');
        }
    });
</script>
</body>

</html>